import wx

class Interactor(object):
    """Interactor base class"""
    
    def install(self, view, presenter):
        self.view = view
        self.presenter = presenter
        self.bind()
    
    def bind(self):
        view = self.view
        view.Bind(wx.EVT_ACTIVATE, self.activate)
        view.Bind(wx.EVT_CLOSE, self.close)
    
    def activate(self, event):
        self.presenter.activate(event.GetActive())
        event.Skip()
    
    def close(self, event):
        self.presenter.close()
        event.Skip()